{% if m.auth2fa[id].is_allowed_reset %}
    {% wire id=#rmcode
            type="submit"
            postback={auth2fa_remove
                id=id
                onerror=[
                    {script script="$('#passcode').select();"},
                    {show target=#error}
                ]
            }
            delegate=`mod_auth2fa`
    %}
    <form action="postback" id="{{ #rmcode }}">
        {% if    (id =/= 1 or m.acl.user =/= 1)
             and (not m.acl.use.mod_admin_identity or not id.is_editable)
        %}
            <p>{_ Please enter the current two-factor authentication code to remove the two-factor authentication from this account. _}</p>

            <div class="form-group label-floating">
                <input class="form-control do_autofocus" type="text" id="passcode" name="passcode" value=""
                       required autocomplete="one-time-code" inputmode="numeric" pattern="[0-9]+"
                       placeholder="{_ Type the code generated by your app _}">
                <label class="control-label">{_ Type the code generated by your app _}</label>
                <p class="text-danger" id="{{ #error }}" style="display: none">
                    {_ The two-factor authentication passcode is not correct. Please try again. _}
                </p>
            </div>
        {% else %}
            <p>{_ Are you sure you want to remove the two-factor authentication from this account? _}</p>
        {% endif %}

        <div class="modal-footer">
            {% button tag="a" class="btn btn-default" text=_"Cancel" action={dialog_close} %}
            <button type="submit" class="btn btn-primary">{_ Remove two-factor authentication _}</button>
        </div>
    </form>
{% else %}
    <p class="alert alert-info">
        {_ Only the user themselves or an admin can remove the two-factor authentication. _}
    </p>

    <div class="modal-footer">
        {% button tag="a" class="btn btn-primary" text=_"Close" action={dialog_close} %}
    </div>
{% endif %}
